#!/bin/bash 

read -p "输入文件:" FILE

if [ -e $FILE ]
then
	echo "存在"
	if [ -f $FILE ]
	then
		echo "是普通文件"
		if [ -w $FILE ]
		then
			echo "有写权限"
			echo "hello world" >> $FILE
			tail -n 5 $FILE
		else
			echo "没有写权限"
		fi
	else
		echo "不是普通文件"
	fi
else
	echo "不存在"
fi
